// 箱体图 需要使用echarts5
(function () {
    let oEchart = echarts.init(document.getElementById('boxplotChart'));
    const boxColors = ['#3983FD', '#41CAFA', '#FFB301', '#6BDD88', '#8CDDFF', '#FFCB30', '#F85A67', '#AB70ED', '#028695', '#FD94C3']

    option = {
        "xAxis": {
            "type": "category",
            nameGap: 0,
            boundaryGap: true,
            "data": ["严重创伤", "中毒", "其他", "创伤性休克", "失血性休克", "急性循环衰竭", "感染", "感染性休克", "胰腺炎", "脓毒症"]
        },
        "yAxis": {
            "type": "value", "name": "治疗前后总体情况"
        },
        "series": [
            {
                name: "test", type: "boxplot",
                boxWidth: [5, 10],
                data: [] //为了让一组图表的间距小一点，在前后各加一组空数据图表
            },
            {
                "name": "治疗前", "type": "boxplot",
                "boxWidth": [5, 10],
                "data": [[0, 0, 0, 1.5, 3.75], [0, 1.7, 10.4, 72.5, 178.7], [0, 2.677, 20, 40, 95.9845],
                [2, 6.5, 9.5, 12, 15], [0, 0.6749999999999999, 8.5, 24.75, 60.8625], [0, 7.5425, 20, 43.5, 97.43625],
                [0, 2, 16.4, 40, 97], [0, 2.66775, 7, 15.549999999999999, 34.873374999999996],
                [0.5, 0.96, 6.8, 24.265, 59.2225], [0, 2.5540000000000003, 17.5, 43.451, 104.79650000000001]]
            },
            {
                "name": "治疗后", "type": "boxplot",
                "boxWidth": [5, 10],
                "data": [[0, 0, 0, 0.28500000000000003, 0.7125000000000001],
                [0, 0.3, 1.3, 12.75, 31.424999999999997], [0, 0.38, 2, 5, 11.93],
                [0.4, 0.475, 0.55, 2.2, 4.7875000000000005], [0, 0.16525, 1.1, 3, 7.252125],
                [0, 0.5, 3, 4, 9.25], [0, 0.5, 2.73, 5, 11.75], [0, 0.4, 0.5, 2, 4.4],
                [0.15, 0.29000000000000004, 0.8, 4.45, 10.690000000000001], [0, 0.4, 2.89, 5.015000000000001, 11.9375]]
            },
            {
                "name": "test", "type": "boxplot",
                "boxWidth": [5, 10],
                "data": []
            }
        ]
    };
    console.log(option);

    oEchart.setOption(option)
})()